package org.summer.netty.bio;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.StandardCharsets;

public class Client {
    public static void main(String[] args) throws IOException {
        SocketChannel sc = SocketChannel.open();
        boolean connect = sc.connect(new InetSocketAddress("127.0.0.1", 8080));
        sc.write(StandardCharsets.UTF_8.encode("Hello world\nI'm lili\nHow are you\n"));
        sc.write(StandardCharsets.UTF_8.encode("Hello world\nI'm lili\nHow are you\n"));
        sc.write(StandardCharsets.UTF_8.encode("Hello world\nI'm lili\nHow are you\n"));
        System.in.read();
    }
}
